package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@SpringBootApplication
@RestController
public class DemoApplication {

    @RequestMapping(value = "/v1", method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE})
    public Map v1() {
        Map map = new HashMap();
        map.put("code", 0);
        map.put("msg", "访问成功");
        return map;
    }


    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}
